package com.peycard.persistence.entities;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Timestamp;
import java.math.BigDecimal;
import java.util.Set;


/**
 * The persistent class for the COMPANY database table.
 * 
 */
@Entity
@NamedQueries({
	@NamedQuery(name="findCompanyByRFC_1", query="SELECT c FROM Company c WHERE c.rfc like :myrfc"),
	@NamedQuery(name="findAllCompanies" , query="SELECT c FROM Company c")
})
public class Company implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="COMPANY_IDCOMPANY_GENERATOR", sequenceName="ID_COMPANY_GENERATOR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="COMPANY_IDCOMPANY_GENERATOR")
	@Column(name="ID_COMPANY")
	private long idCompany;

	@Column(name="CORPORATE_SPIN")
	private String corporateSpin;

	private String country;

	private BigDecimal fax;

	private String infonavit;

	@Column(name="IS_ACTIVE")
	private BigDecimal isActive;

	@Column(name="LEGAL_REPRESANTIVE")
	private String legalRepresantive;

	@Column(name="NUMBER_IN_EX")
	private BigDecimal numberInEx;

	@Column(name="POSTAL_CODE")
	private BigDecimal postalCode;

	private String rfc;

	@Column(name="SAVE_DATA")
	private Timestamp saveData;

	@Column(name="SOCIAL_REASON")
	private String socialReason;

	private String state;

	private String stps;

	@Column(name="STPS_REPRESENTATIVE")
	private String stpsRepresentative;

	private String street;

	private String suburb;

	@Column(name="TELEPHONE_1")
	private BigDecimal telephone1;

	@Column(name="TELEPHONE_2")
	private BigDecimal telephone2;

	private String tradename;

	private String username;

	private String web;

	//bi-directional many-to-one association to EmailConfig
    @ManyToOne
	@JoinColumn(name="ID_CONFIG_EMAIL")
	private EmailConfig emailConfig;

	//bi-directional many-to-one association to Email
	@OneToMany(mappedBy="company")
	private Set<Email> emails;

    public Company() {
    }

	public long getIdCompany() {
		return this.idCompany;
	}

	public void setIdCompany(long idCompany) {
		this.idCompany = idCompany;
	}

	public String getCorporateSpin() {
		return this.corporateSpin;
	}

	public void setCorporateSpin(String corporateSpin) {
		this.corporateSpin = corporateSpin;
	}

	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public BigDecimal getFax() {
		return this.fax;
	}

	public void setFax(BigDecimal fax) {
		this.fax = fax;
	}

	public String getInfonavit() {
		return this.infonavit;
	}

	public void setInfonavit(String infonavit) {
		this.infonavit = infonavit;
	}

	public BigDecimal getIsActive() {
		return this.isActive;
	}

	public void setIsActive(BigDecimal isActive) {
		this.isActive = isActive;
	}

	public String getLegalRepresantive() {
		return this.legalRepresantive;
	}

	public void setLegalRepresantive(String legalRepresantive) {
		this.legalRepresantive = legalRepresantive;
	}

	public BigDecimal getNumberInEx() {
		return this.numberInEx;
	}

	public void setNumberInEx(BigDecimal numberInEx) {
		this.numberInEx = numberInEx;
	}

	public BigDecimal getPostalCode() {
		return this.postalCode;
	}

	public void setPostalCode(BigDecimal postalCode) {
		this.postalCode = postalCode;
	}

	public String getRfc() {
		return this.rfc;
	}

	public void setRfc(String rfc) {
		this.rfc = rfc;
	}

	public Timestamp getSaveData() {
		return this.saveData;
	}

	public void setSaveData(Timestamp saveData) {
		this.saveData = saveData;
	}

	public String getSocialReason() {
		return this.socialReason;
	}

	public void setSocialReason(String socialReason) {
		this.socialReason = socialReason;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getStps() {
		return this.stps;
	}

	public void setStps(String stps) {
		this.stps = stps;
	}

	public String getStpsRepresentative() {
		return this.stpsRepresentative;
	}

	public void setStpsRepresentative(String stpsRepresentative) {
		this.stpsRepresentative = stpsRepresentative;
	}

	public String getStreet() {
		return this.street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getSuburb() {
		return this.suburb;
	}

	public void setSuburb(String suburb) {
		this.suburb = suburb;
	}

	public BigDecimal getTelephone1() {
		return this.telephone1;
	}

	public void setTelephone1(BigDecimal telephone1) {
		this.telephone1 = telephone1;
	}

	public BigDecimal getTelephone2() {
		return this.telephone2;
	}

	public void setTelephone2(BigDecimal telephone2) {
		this.telephone2 = telephone2;
	}

	public String getTradename() {
		return this.tradename;
	}

	public void setTradename(String tradename) {
		this.tradename = tradename;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getWeb() {
		return this.web;
	}

	public void setWeb(String web) {
		this.web = web;
	}

	public EmailConfig getEmailConfig() {
		return this.emailConfig;
	}

	public void setEmailConfig(EmailConfig emailConfig) {
		this.emailConfig = emailConfig;
	}
	
	public Set<Email> getEmails() {
		return this.emails;
	}

	public void setEmails(Set<Email> emails) {
		this.emails = emails;
	}
	
}